In the reaction of N-(3-chloro-4-cyano-5-dimethylamino-2-aza-2,4-pentadienylidene)-N,N-dimeth ylammonium perchlorate with nucleophilic reagents, substitution of the chlorine atom occurs [Ch. Jutz and W. Muller, Angew. Chem., 78, 1059 (1966)]. Thus, with an aqueous ammonia or ammonium chloride solution 4-dimethylamino-5-pyrimidinylcarbonitrile is produced with a splitting off of the two dimethylamino groups and simultaneous substitution of the chlorine atom.